package com.hlhj.funlike_businessqzxd

import android.app.Service
import android.content.Intent
import android.os.Handler
import android.os.IBinder
import android.os.Message
import android.util.Log
import com.tencent.bugly.beta.Beta

class CheckUpdataService :Service() {
    private val handler=object :Handler(){
        override fun handleMessage(msg: Message?) {
            super.handleMessage(msg)
            Log.e("fhp","检查更新")
            Beta.checkUpgrade(false,true)
            this.sendEmptyMessageDelayed(1,5000)
        }
    }

    override fun onCreate() {
        super.onCreate()
        Log.e("fhp","开始刷新?")

        handler.sendEmptyMessage(1)

    }
    override fun onBind(intent: Intent?): IBinder? {
        return null
    }

    override fun onDestroy() {
        super.onDestroy()
        handler.removeMessages(1)
    }
}